let Items = {
    head: [{
        name: "居民头巾(轻)",
        weight: 0.7,
        tenacity: 0,
        reduceDmg: {physics: 0.1,pount: 1.1,cut: 1.1,thorn: 0.6,magic: 3.9,fire: 3.5,thunder: 3.7,holy: 3.9,},
        dk: {immune: 12,robust: 8,dead: 24,san: 23,}
    },{
        name: "随从风帽",
        weight: 1.4,
        tenacity: 0,
        reduceDmg: {physics: 1.8,pount: 1.4,cut: 0.9,thorn: 0.9,magic: 4.4,fire: 4.2,thunder: 4.5,holy: 4.5,},
        dk: {immune: 15,robust: 8,dead: 29,san: 29,}
    },{
        name: "罪人风帽",
        weight: 1.4,
        tenacity: 0,
        reduceDmg: {physics: 0.9,pount: 1.4,cut: 1.8,thorn: 0.2,magic: 4.4,fire: 4,thunder: 4.5,holy: 4.6,},
        dk: {immune: 15,robust: 9,dead: 31,san: 27,}
    },{
        name: "囚犯铁面具",
        weight: 8.6,
        tenacity: 11,
        reduceDmg: {physics: 6.8,pount: 5.9,cut: 7,thorn: 6.8,magic: 4.6,fire: 4.9,thunder: 4.5,holy: 4.8,},
        dk: {immune: 29,robust: 44,dead: 20,san: 35,}
    },{
        name: "观星者风帽",
        weight: 1.7,
        tenacity: 1,
        reduceDmg: {physics: 1.8,pount: 1.4,cut: 1.4,thorn: 1.4,magic: 4.6,fire: 4.5,thunder: 4.6,holy: 4.5,},
        dk: {immune: 18,robust: 9,dead: 27,san: 31,}
    },{
        name: "卡勒罗斯辉石头罩",
        weight: 5.1,
        tenacity: 3,
        reduceDmg: {physics: 4.4,pount: 3.1,cut: 5.2,thorn: 4.8,magic: 4.4,fire: 4.5,thunder: 3.4,holy: 3.8,},
        dk: {immune: 16,robust: 26,dead: 10,san: 10,}
    },{
        name: "双贤辉石头罩",
        weight: 5.1,
        tenacity: 3,
        reduceDmg: {physics: 4.4,pount: 3.1,cut: 5.2,thorn: 4.8,magic: 4.4,fire: 4.5,thunder: 3.4,holy: 3.8,},
        dk: {immune: 16,robust: 26,dead: 10,san: 10,}
    },{
        name: "阿尔佩利希尖帽",
        weight: 1.7,
        tenacity: 0,
        reduceDmg: {physics: 1.8,pount: 1.4,cut: 1.8,thorn: 1.8,magic: 4.6,fire: 4.2,thunder: 4.4,holy: 4.6,},
        dk: {immune: 16,robust: 10,dead: 31,san: 29,}
    },{
        name: "指头女巫帽子",
        weight: 2.2,
        tenacity: 1,
        reduceDmg: {physics: 2.1,pount: 1.8,cut: 1.8,thorn: 1.4,magic: 4.8,fire: 4.6,thunder: 4.6,holy: 4.8,},
        dk: {immune: 18,robust: 10,dead: 31,san: 31,}
    },{
        name: "调香师风帽",
        weight: 1.7,
        tenacity: 1,
        reduceDmg: {physics: 1.4,pount: 2.1,cut: 1.8,thorn: 1.4,magic: 4.6,fire: 4.2,thunder: 4.4,holy: 4.6,},
        dk: {immune: 26,robust: 8,dead: 29,san: 27,}
    },{
        name: "旅行帽子",
        weight: 1.7,
        tenacity: 1,
        reduceDmg: {physics: 1.8,pount: 1.8,cut: 1.4,thorn: 0.9,magic: 4.6,fire: 4.6,thunder: 4.4,holy: 4.6,},
        dk: {immune: 21,robust: 9,dead: 27,san: 29,}
    },{
        name: "玛雷家面具",
        weight: 2.2,
        tenacity: 1,
        reduceDmg: {physics: 2.1,pount: 2.3,cut: 1.8,thorn: 1.4,magic: 4.6,fire: 4.5,thunder: 4.5,holy: 4.6,},
        dk: {immune: 20,robust: 14,dead: 33,san: 35,}
    },{
        name: "辉石粪金龟",
        weight: 5.1,
        tenacity: 2,
        reduceDmg: {physics: -5.8,pount: -5.6,cut: -5.8,thorn: -5.8,magic: -4.9,fire: -4.9,thunder: -4.9,holy: -5.1,},
        dk: {immune: 42,robust: 22,dead: 26,san: 27,}
    },{
        name: "小恶魔头罩(长生者)",
        weight: 8.1,
        tenacity: 8,
        reduceDmg: {physics: 5.8,pount: 5.2,cut: 5.8,thorn: 6.1,magic: 5,fire: 5.8,thunder: 4.8,holy: 5,},
        dk: {immune: 42,robust: 22,dead: 26,san: 27,}
    },{
        name: "诺克斯镜面盔",
        weight: 7.5,
        tenacity: 4,
        reduceDmg: {physics: 4,pount: 3.4,cut: 5.5,thorn: 5.0,magic: 6.7,fire: 5.3,thunder: 4.2,holy: 5.3,},
        dk: {immune: 29,robust: 33,dead: 42,san: 26,}
    },{
        name: "银色泪滴面具",
        weight: 4.6,
        tenacity: 3,
        reduceDmg: {physics: 4.2,pount: 3.6,cut: 3.8,thorn: 3.1,magic: 5.5,fire: 5.2,thunder: 5,holy: 5.3,},
        dk: {immune: 26,robust: 20,dead: 44,san: 44,}
    },{
        name: "蓝色头巾",
        weight: 2.7,
        tenacity: 1,
        reduceDmg: {physics: 2.8,pount: 2.8,cut: 2.3,thorn: 2.3,magic: 3.1,fire: 3.4,thunder: 3.8,holy: 2.8,},
        dk: {immune: 24,robust: 15,dead: 18,san: 18,}
    },{
        name: "黑布风帽",
        weight: 3,
        tenacity: 1,
        reduceDmg: {physics: 2.8,pount: 3.1,cut: 3.1,thorn: 3.1,magic: 3.1,fire: 3.4,thunder: 3.6,holy: 3.1,},
        dk: {immune: 33,robust: 16,dead: 18,san: 16,}
    },{
        name: "噩兆笑脸面具",
        weight: 3,
        tenacity: 2,
        reduceDmg: {physics: 3.1,pount: 2.8,cut: 2.5,thorn: 2.5,magic: 3.1,fire: 3.4,thunder: 4,holy: 3.6,},
        dk: {immune: 29,robust: 12,dead: 20,san: 20,}
    },{
        name: "小兵头盔",
        weight: 3.6,
        tenacity: 2,
        reduceDmg: {physics: 3.6,pount: 3.4,cut: 3.1,thorn: 3.1,magic: 3.8,fire: 4.2,thunder: 4.2,holy: 3.8,},
        dk: {immune: 27,robust: 18,dead: 23,san: 23,}
    },{
        name: "强盗风帽",
        weight: 3.3,
        tenacity: 2,
        reduceDmg: {physics: 2.8,pount: 3.6,cut: 2.8,thorn: 3.1,magic: 3.8,fire: 3.8,thunder: 4.2,holy: 3.6,},
        dk: {immune: 24,robust: 15,dead: 22,san: 22,}
    },{
        name: "恶兵头盔",
        weight: 3.6,
        tenacity: 2,
        reduceDmg: {physics: 3.4,pount: 3.8,cut: 3.6,thorn: 3.1,magic: 3.8,fire: 3.8,thunder: 4,holy: 3.8,},
        dk: {immune: 31,robust: 16,dead: 23,san: 23,}
    },{
        name: "勇者头带",
        weight: 2.7,
        tenacity: 2,
        reduceDmg: {physics: 2.3,pount: 3.1,cut: 2.5,thorn: 2.8,magic: 2.8,fire: 3.4,thunder: 3.6,holy: 3.4,},
        dk: {immune: 22,robust: 14,dead: 16,san: 18,}
    },{
        name: "锁子头盔",
        weight: 3.8,
        tenacity: 4,
        reduceDmg: {physics: 4.2,pount: 3.1,cut: 4.6,thorn: 4.2,magic: 2.5,fire: 3.8,thunder: 2.1,holy: 2.8,},
        dk: {immune: 11,robust: 18,dead: 5,san: 8,}
    },{
        name: "铁头盔",
        weight: 3.8,
        tenacity: 4,
        reduceDmg: {physics: 4.4,pount: 3.1,cut: 4,thorn: 4.2,magic: 2.5,fire: 3.1,thunder: 2.3,holy:3.1,},
        dk: {immune: 12,robust: 18,dead: 8,san: 8,}
    },{
        name: "葛瑞克头盔",
        weight: 4,
        tenacity: 5,
        reduceDmg: {physics: 4.4,pount: 3.6,cut: 4.4,thorn: 4.2,magic: 3.1,fire: 3.6,thunder: 2.5,holy:3.1,},
        dk: {immune: 12,robust: 22,dead: 9,san: 9,}
    },{
        name: "凯丹头盔",
        weight: 4,
        tenacity: 5,
        reduceDmg: {physics: 4.4,pount: 3.4,cut: 4.4,thorn: 4.4,magic: 3.1,fire: 3.4,thunder: 2.8,holy:3.1,},
        dk: {immune: 12,robust: 22,dead: 9,san: 9,}
    },{
        name: "人偶兵鸟笼盔",
        weight: 3.8,
        tenacity: 5,
        reduceDmg: {physics: 4.4,pount: 3.1,cut: 4,thorn: 3.8,magic: 3.1,fire: 3.1,thunder: 2.5,holy:2.5,},
        dk: {immune: 11,robust: 18,dead: 9,san: 8,}
    },{
        name: "骑士头盔",
        weight: 4.6,
        tenacity: 6,
        reduceDmg: {physics: 4.4,pount: 4.2,cut: 4.8,thorn: 4.8,magic: 3.8,fire: 3.8,thunder: 3.4,holy:3.1,},
        dk: {immune: 11,robust: 22,dead: 8,san: 8,}
    },{
        name: "巨盔",
        weight: 5.9,
        tenacity: 7,
        reduceDmg: {physics: 5.5,pount: 4.2,cut: 5.8,thorn: 5.2,magic: 4.2,fire: 4.6,thunder: 3.8,holy:4.2,},
        dk: {immune: 16,robust: 29,dead: 11,san: 11,}
    },{
        name: "卡利亚骑士头盔",
        weight: 4.6,
        tenacity: 4,
        reduceDmg: {physics: 4.2,pount: 3.8,cut: 4.4,thorn: 4.2,magic: 4.4,fire: 4.2,thunder: 3.4,holy:4.2,},
        dk: {immune: 12,robust: 20,dead: 10,san: 9,}
    },{
        name: "葛瑞克骑士头盔",
        weight: 5.1,
        tenacity: 6,
        reduceDmg: {physics: 4.8,pount: 4.2,cut: 5,thorn: 4.6,magic: 3.8,fire: 4.2,thunder: 3.4,holy:3.8,},
        dk: {immune: 15,robust: 24,dead: 10,san: 10,}
    },{
        name: "格蜜尔骑士头盔",
        weight: 5.1,
        tenacity: 6,
        reduceDmg: {physics: 4.8,pount: 4.2,cut: 5,thorn: 4.6,magic: 3.8,fire: 4.4,thunder: 3.6,holy:3.8,},
        dk: {immune: 15,robust: 23,dead: 10,san: 10,}
    },{
        name: "罗德尔骑士头盔",
        weight: 5.1,
        tenacity: 6,
        reduceDmg: {physics: 4.8,pount: 4.4,cut: 4.8,thorn: 4.8,magic: 3.8,fire: 4,thunder: 3.6,holy:3.8,},
        dk: {immune: 15,robust: 24,dead: 10,san: 10,}
    },{
        name: "猎犬骑士头盔",
        weight: 4.6,
        tenacity: 4,
        reduceDmg: {physics: 4.4,pount: 4,cut: 5,thorn: 4.8,magic: 3.4,fire: 3.6,thunder: 2.5,holy:3.6,},
        dk: {immune: 14,robust: 22,dead: 10,san: 10,}
    },{
        name: "尊腐骑士头盔",
        weight: 6.4,
        tenacity: 7,
        reduceDmg: {physics: 5.2,pount: 4.8,cut: 5.8,thorn: 6.3,magic: 4.5,fire: 4.6,thunder: 4,holy:4.8,},
        dk: {immune: 27,robust: 29,dead: 14,san: 12,}
    },{
        name: "战鬼头盔",
        weight: 4.4,
        tenacity: 5,
        reduceDmg: {physics: 4.7,pount: 4.1,cut: 4.7,thorn: 4.5,magic: 3.5,fire: 3.9,thunder: 2.4,holy:3.3,},
        dk: {immune: 14,robust: 23,dead: 8,san: 8,}
    },{
        name: "孪生头盔",
        weight: 5.1,
        tenacity: 5,
        reduceDmg: {physics: 4.8,pount: 4.4,cut: 5.2,thorn: 4.2,magic: 4,fire: 4,thunder: 3.1,holy:3.6,},
        dk: {immune: 14,robust: 23,dead: 23,san: 9,}
    },{
        name: "王骸骨头盔",
        weight: 4.6,
        tenacity: 5,
        reduceDmg: {physics: 4.2,pount: 4,cut: 4.6,thorn: 4.2,magic: 3.4,fire: 3.6,thunder: 2.8,holy:3.1,},
        dk: {immune: 15,robust: 24,dead: 5,san: 10,}
    },{
        name: "失乡骑士头盔(轻)",
        weight: 7.1,
        tenacity: 8,
        reduceDmg: {physics: 7,pount: 5.5,cut: 7.1,thorn: 6.4,magic: 5,fire: 5,thunder: 4.9,holy:4.9,},
        dk: {immune: 21,robust: 30,dead: 14,san: 13,}
    },{
        name: "鳞片头盔",
        weight: 6.8,
        tenacity: 9,
        reduceDmg: {physics: 6.1,pount: 5.2,cut: 6.3,thorn: 6.1,magic: 4.7,fire: 4.9,thunder: 4.6,holy:4.7,},
        dk: {immune: 24,robust: 35,dead: 16,san: 16,}
    },{
        name: "莱恩尼尔头盔",
        weight: 9.1,
        tenacity: 12,
        reduceDmg: {physics: 6.3,pount: 5.9,cut: 7,thorn: 7.2,magic: 4.8,fire: 5.3,thunder: 4.6,holy:4.8,},
        dk: {immune: 27,robust: 42,dead: 22,san: 18,}
    },
    ],
    body: [{
        name: "布制上衣",
        weight: 3.2,
        tenacity: 1,
        reduceDmg: {physics: 5.3,pount: 4.2,cut: 2.7,thorn: 4.2,magic: 12.8,fire: 12.4,thunder: 11.9,holy: 12.4,},
        dk: {immune: 42,robust: 23,dead: 60,san: 60,}
    },{
        name: "大山羊",
        weight: 26.5,
        tenacity: 47,
        reduceDmg: {physics: 20.4,pount: 20.2,cut: 18.3,thorn: 18.3,magic: 13.3,fire: 13.5,thunder: 14.9,holy: 12.8,},
        dk: {immune: 71,robust: 83,dead: 46,san: 55,}
    },{
        name: "居民便衣",
        weight: 5.1,
        tenacity: 2,
        reduceDmg: {physics: 4.2,pount: 6.7,cut: 6.7,thorn: 6.2,magic: 13,fire: 12.6,thunder: 12.6,holy: 12.8,},
        dk: {immune: 46,robust: 24,dead: 83,san: 76,}
    },{
        name: "权贵上衣",
        weight: 4.9,
        tenacity: 2,
        reduceDmg: {physics: 7.8,pount: 8.6,cut: 7.8,thorn: 7.8,magic: 6.5,fire: 6.9,thunder: 7.8,holy: 6.5,},
        dk: {immune: 47,robust: 33,dead: 30,san: 36,}
    },{
        name: "随从上衣",
        weight: 5.1,
        tenacity: 2,
        reduceDmg: {physics: 6.7,pount: 6.1,cut: 5.3,thorn: 5.3,magic: 12.8,fire: 12.6,thunder: 13,holy: 13,},
        dk: {immune: 42,robust: 23,dead: 83,san: 83,}
    },{
        name: "囚犯布衣",
        weight: 3.2,
        tenacity: 1,
        reduceDmg: {physics: 4.2,pount: 5.3,cut: 5.3,thorn: 4.2,magic: 11.9,fire: 11.4,thunder: 11.4,holy: 12.6,},
        dk: {immune: 42,robust: 23,dead: 63,san: 63,}
    },{
        name: "观星者长袍",
        weight: 6.3,
        tenacity: 5,
        reduceDmg: {physics: 6.7,pount: 6.1,cut: 6.1,thorn: 6.1,magic: 13.5,fire: 13,thunder: 13.3,holy: 13,},
        dk: {immune: 50,robust: 24,dead: 76,san: 90,}
    },{
        name: "雷亚鲁卡利亚长袍",
        weight: 4.1,
        tenacity: 1,
        reduceDmg: {physics: 5.3,pount: 6.1,cut: 6.1,thorn: 2.7,magic: 13.5,fire: 12.6,thunder: 12.4,holy: 12.8,},
        dk: {immune: 42,robust: 18,dead: 63,san: 67,}
    },{
        name: "阿尔佩利希上衣",
        weight: 4.1,
        tenacity: 1,
        reduceDmg: {physics: 5.3,pount: 4.2,cut: 5.3,thorn: 5.3,magic: 12.8,fire: 11.9,thunder: 12.4,holy: 12.8,},
        dk: {immune: 38,robust: 23,dead: 71,san: 67,}
    },{
        name: "死眠连衣裙",
        weight: 3.2,
        tenacity: 1,
        reduceDmg: {physics: 0.6,pount: 2.7,cut: 0.6,thorn: 0.6,magic: 11.9,fire: 11.4,thunder: 11.9,holy: 12.4,},
        dk: {immune: 38,robust: 11,dead: 107,san: 63,}
    }
    ],
    arm: [{
        name: "test_arm",
        weight: 11.2,
        tenacity: 14,
        reduceDmg: {physics: 12.6,pount: 11,cut: 13.2,thorn: 12.1,magic: 9.2,fire: 12.2,thunder: 10,holy: 10.2,},
        dk: {immune: 22,robust: 24,dead: 10,san: 16,}
    },],
    leg: [{
        name: "test_leg",
        weight: 11.2,
        tenacity: 14,
        reduceDmg: {physics: 12.6,pount: 11,cut: 13.2,thorn: 12.1,magic: 9.2,fire: 12.2,thunder: 10,holy: 10.2,},
        dk: {immune: 22,robust: 24,dead: 10,san: 16,}
    },]
}
console.log(Items.head.length);
let ret = []

Items.head.forEach(headArmor => {
    Items.body.forEach(bodyArmor => {
        Items.arm.forEach(armArmor => {
            Items.leg.forEach(legArmor => {
                let physicsReduce = calcArmorReduceDmg([headArmor.reduceDmg.physics,bodyArmor.reduceDmg.physics,armArmor.reduceDmg.physics,legArmor.reduceDmg.physics,])
                let pountReduce = calcArmorReduceDmg([headArmor.reduceDmg.pount,bodyArmor.reduceDmg.pount,armArmor.reduceDmg.pount,legArmor.reduceDmg.pount,])
                let cutReduce = calcArmorReduceDmg([headArmor.reduceDmg.cut,bodyArmor.reduceDmg.cut,armArmor.reduceDmg.cut,legArmor.reduceDmg.cut,])
                let thornReduce = calcArmorReduceDmg([headArmor.reduceDmg.thorn,bodyArmor.reduceDmg.thorn,armArmor.reduceDmg.thorn,legArmor.reduceDmg.thorn,])
                let magicReduce = calcArmorReduceDmg([headArmor.reduceDmg.magic,bodyArmor.reduceDmg.magic,armArmor.reduceDmg.magic,legArmor.reduceDmg.magic,])
                let fireReduce = calcArmorReduceDmg([headArmor.reduceDmg.fire,bodyArmor.reduceDmg.fire,armArmor.reduceDmg.fire,legArmor.reduceDmg.fire,])
                let thunderReduce = calcArmorReduceDmg([headArmor.reduceDmg.thunder,bodyArmor.reduceDmg.thunder,armArmor.reduceDmg.thunder,legArmor.reduceDmg.thunder,])
                let holyReduce = calcArmorReduceDmg([headArmor.reduceDmg.holy,bodyArmor.reduceDmg.holy,armArmor.reduceDmg.holy,legArmor.reduceDmg.holy,])
                ret.push({
                    name: `${headArmor.name} + ${bodyArmor.name} + ${armArmor.name} + ${legArmor.name}`,
                    weight: headArmor.weight + bodyArmor.weight + armArmor.weight + legArmor.weight,
                    physicsReduce,pountReduce,cutReduce,thornReduce,magicReduce,fireReduce,thunderReduce,holyReduce,
                })
            })
        })
    })
})

ret.sort((b,a) => b.physicsReduce/b.weight - a.physicsReduce/a.weight)

ret.forEach(v => {
    console.log(v);
})

function calcArmorReduceDmg(dfArr) {
    let ret = 100;
    dfArr.forEach(v => {
        ret *= (1-v/100)
    })
    return 100 - ret
}